﻿<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="utf-8" />
	<th:block th:include="include :: header('电源管理')" />
	<link href="/css/opt-ui.css" rel="stylesheet"/>

</head>

<body>
<div class="wrapper wrapper-content">
    <div class="row">

		<div class="col-sm-6">
			<h1 style="margin-left: 15%;">磁盘阵列电源控制</h1>
			<div style="height: 235px;width: 70%;background: url(/img/control_system.jpg) no-repeat;background-size: 92% 92%;"></div>
			<a class="opta" href="#" onclick="powerOpt(1,1)">关机</a>
			<a class="opta" href="#" onclick="powerOpt(1,2)">重启</a>
		</div>
		<div class="col-sm-6">
			<h1 style="margin-left: 15%;">控制分机电源控制</h1>
			<div style="height: 235px;width: 70%;background: url(/img/control_system.jpg) no-repeat;background-size: 92% 92%;"></div>
			<!-- 
			<a class="opta" href="#">开机</a>
			 -->
			<a class="opta" href="#" onclick="powerOpt(2,1)">关机</a>
			<a class="opta" href="#" onclick="powerOpt(2,2)">重启</a>
		</div>

	</div>
</div>	

<th:block th:include="include :: footer" />
<script language="javascript">
	function powerOpt(serverNum,optNum){
		$.modal.confirm("该操作可能导致当前系统无法访问，确认要执行吗？", function() {
			//$.operate.post("/hddata/hdPowerOpt", { "serverNum": serverNum, "optNum": optNum });
			//发送AJAX请求
		   	 $.ajax({
	           url: "/hddata/hdPowerOpt",
	           data: {
	        	   "serverNum" : serverNum,
	        	   "optNum" : optNum
	           },
	           type: "post",
	           success: function(result) {
	        	   $.modal.msg("执行成功！");
	           }
	       })　
	    })
	}
</script>

</body>

</html>